export default class NetUtils {
  static async Post(url, body) {
    try {
      // 注意这里的await语句，其所在的函数必须有async关键字声明
      let response = await fetch(url, {
        method: "POST",
        headers: {
          Accept: "application/json",
          "Content-Type": "application/json"
        },
        body: JSON.stringify(body)
      });

      let responseJson = await response.json();
      return responseJson;
    } catch (error) {
      console.error(error);
    }
  }
}
